<template>
	<view class="main">
		<header-vue :back="true">
			<template v-slot:btnLt>
				<view class="flex search-box">
					<i class="iconfont icon-search font40"></i>
					<input v-model="params.keyword" placeholder="搜索" class="input" @input="searchInput" />
				</view>
			</template>
		</header-vue>
		<!-- <view class="content">
			<view class="flex between search-title">
				<view class="font30 fontbold-500">历史搜索</view>
				<view class="flex font24 del"><i class="iconfont icon-del font28" style="margin-right: 4rpx;"></i>全部删除</view>
			</view>
			<view class="search-history">
				<view class="flex between item" v-for="item in 4">
					<view class="flex">
						<i class="iconfont icon-clock font24" style="margin-right: 8rpx;"></i>
						<view class="font28">秋季上衣</view>
					</view>
					<i class="iconfont icon-close font24"></i>
				</view>
			</view>
		</view> -->
		<scroll-view class="list" :scroll-y="true">
			<view v-for="item in 10" :key="item" class="white-box">
				<view class="flex start store-title font24">
					<i class="iconfont icon-store font24" style="height: 24rpx;"></i>
					<view>新宜家高桥店</view>
				</view>
				<view class="flex">
					<image :src="IMAGE_URL + '/static/login/bg.png'"></image>
					<view class="flex column between start store-info">
						<view>
							<view class="flex start">
								<view class="tag font20">自营</view>
								<view class="font28 fontbold-500">巴旦木去核奶枣零食夹心</view>
							</view>
							<view class="sale-num font24">已售36</view>
						</view>
						<view class="flex between font20 num">
							<view class="flex price">
								<text class="font28">￥</text>
								<text class="font36">63</text>
								<text class="font28">.10</text>
							</view>
							<view class="flex">
								<view class="flex">
									<i class="iconfont icon-like font28"></i>
									80.1%
								</view>
								<view class="flex">
									<i class="iconfont icon-comment font28"></i>
									2041
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import headerVue from '@/components/header.vue'
	import { searchApi } from '../../api/modules/shop'
	import appConfig from '@/config/app.js'

	export default {
		data() {
			return {
				IMAGE_URL: appConfig.IMAGE_URL,
				params: {
					keyword: ''
				}
			}
		},
		components: {
			headerVue
		},
		mounted() {
		},
		methods: {
			searchInput() {
				console.log(11)
				searchApi(this.params)
			}
		}
	}
</script>
<style lang="scss" scoped>
	.main {
		background: #F6F6F6;
		height: 100vh;
	}

	.list {
		padding: 28rpx 32rpx;
		box-sizing: border-box;
	}

	.search-box {
		height: 64rpx;
		background: #EFF9FF;
		border-radius: 60rpx;
		padding: 0 28rpx;
		width: 100%;
		box-sizing: border-box;
		position: relative;
		left: -10rpx;

		.iconfont {
			color: $uni-text-color-grey;
			margin-right: 20rpx;
		}

		.input {
			width: 100%;
			height: 100%;
			color: $uni-text-color-grey;
		}
	}

	.search-title {
		margin: 28rpx 32rpx;

		.del {
			color: $uni-text-color-grey1;
		}
	}

	.search-history {
		padding: 40rpx 32rpx 40rpx;
		box-sizing: border-box;
		background: $uni-bg-color;

		.item {
			margin-top: 40rpx;

			&:nth-child(1) {
				margin: 0;
			}

			.iconfont {
				color: $uni-text-color-grey1;
			}
		}
	}

	.white-box {
		background: $uni-bg-color;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.08);
		border-radius: 20rpx;
		padding: 20rpx;
		box-sizing: border-box;
		margin-bottom: 28rpx;

		.store-title {
			padding-bottom: 20rpx;
			border-bottom: 1rpx solid #DDDDDD;
			margin-bottom: 20rpx;
		}

		.iconfont {
			margin-right: 4rpx;
		}

		image {
			width: 200rpx;
			height: 200rpx;
			border-radius: 16rpx;
			margin-right: 20rpx;
			flex-shrink: 0;
		}

		.store-info {
			width: 100%;
			height: 200rpx;
			align-items: flex-start;

			.tag {
				padding: 0 8rpx;
				height: 28rpx;
				box-sizing: border-box;
				background: #DF9824;
				border-radius: 4rpx;
				margin-right: 8rpx;
				color: $uni-text-color-inverse;
			}

			.sale-num {
				color: $uni-text-color-grey;
				margin-top: 20rpx;
			}

			.num {
				color: $uni-text-color-grey1;
				width: 100%;
			}

			.icon-comment {
				margin-left: 26rpx;
			}
		}
	}
</style>